import request from '@/utils/request';
const apiUrls = {
  getSubsidy: '/front/policy/subsidy',
  getAnalysis: '/front/policy/analysis',
  getLoan: '/front/policy/loan',
  getInsurance: '/front/policy/insurance',
  getOverview: '/front/policy/overview',
  getGrant: '/front/policy/grant',
  policyLand: '/front/policy/land',
  distribution: '/front/policy/distribution'
};
export function getSubsidy (type, areaCode) {
  return request({
    url: `${apiUrls.getSubsidy}?type=${type}&areaCode=${areaCode}`,
    method: 'get'
  });
}

export function getAnalysis (data) {
  return request({
    url: `${apiUrls.getAnalysis}?areaCode=${data}`,
    method: 'get'
  });
}
export function getLoan (data) {
  return request({
    url: `${apiUrls.getLoan}?areaCode=${data}`,
    method: 'get'
  });
}
export function getInsurance (data) {
  return request({
    url: `${apiUrls.getInsurance}?areaCode=${data}`,
    method: 'get'
  });
}

export function getOverview (data) {
  return request({
    url: `${apiUrls.getOverview}?areaCode=${data}`,
    method: 'get'
  });
}
export function distribution (data) {
  return request({
    url: `${apiUrls.distribution}`,
    method: 'get',
    params: data
  });
}
export function getPolicylandByName (data) {
  return request({
    // baseURL: '/prod-api-yanshi',
    url: `${apiUrls.policyLand}`,
    method: 'get',
    params: data
  });
}
export function getGrant (pageSize, pageNum, subsidyType, areaCode) {
  return request({
    url: `${apiUrls.getGrant}?pageSize=${pageSize}&pageNum=${pageNum}&subsidyType=${subsidyType}&areaCode=${areaCode}`,
    method: 'get'
  });
}